package com.hfi.ood.litejunit.v2.framework.decorator;

import com.hfi.ood.litejunit.v2.framework.Test;
import com.hfi.ood.litejunit.v2.framework.TestResult;
import lombok.Getter;

/**
 * @author ChangLiang
 * @date 2020/5/27
 */
public class TestDecorator implements Test {

    @Getter
    private Test testDecorator;

    public TestDecorator(Test test) {
        this.testDecorator = test;
    }

    @Override
    public int countTestCases() {
        return testDecorator.countTestCases();
    }

    @Override
    public void run(TestResult testResult) {
        basicRun(testResult);
    }

    protected void basicRun(TestResult testResult) {
        testDecorator.run(testResult);
    }
}
